package com.dys.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: 疾风
 * @ClassName: Servlet03
 * @Description: Request监听器监听的Servlet
 * @CreateDate: 2024/09/25
 * @Version: v1.0.0
 */
@WebServlet(urlPatterns = "/servlet03.do")
public class Servlet03 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行Servlet03类中的service()方法......");
        req.setAttribute("name","王大锤");
        req.setAttribute("name","王大虎");
        req.removeAttribute("name");
        resp.setContentType("text/html;charset=utf-8");
        resp.getWriter().write("Servlet03响应的结果");
    }
}
